

struct Node{
    Node * pre;
    Node * next;
    int val;
};





Node * pre = nullptr;
Node * curr = nullptr;
curr = head;
while(curr->next){
    Node *temp = curr;
    curr->next = pre;
    pre = curr
    curr = temp->next;
    
}